package com.example.autooperation.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.autooperation.entity.Step;
import com.example.autooperation.mapper.StepMapper;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StepService extends ServiceImpl<StepMapper, Step> {
    public List<Step> getStepsByTaskId(int taskId) {
        QueryWrapper<Step> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("task_id", taskId).orderByAsc("step_order");
        return this.list(queryWrapper);
    }
} 